home *** CD-ROM | disk | FTP | other *** search
- # return #$1
- a.act {
- if ($readini -n $td(msg.txt) $a.nknum($1) act [ $+ [ $2 ] ] == yes) return $colnum(Action) $+ $3-
- else return $3-
- }
- a.addy return $readini -n $td(msg.txt) $1 addy
- a.date return $asctime( [ $readini -n $td(msg.txt) $1 ldate ] ,dd-mm-yy @ h:nntt)
- a.dte return $asctime( [ $readini -n $td(msg.txt) $1 d [ $+ [ $2 ] ] ] ,dd-mm-yy @ h:nntt)
- a.f return $remove($1-,/,|)
- a.lastaddy return ( $+ $readini -n $td(msg.txt) messages lastrecaddy $+ )
- a.lastdate return $asctime( [ $readini -n $td(msg.txt) messages lastrecdate ] ,dd-mm-yy @ h:nntt)
- a.lastmsg return $readini -n $td(msg.txt) messages lastrecmsg
- a.lastnick return $readini -n $td(msg.txt) messages lastrecnick
- ab return [[ $+ $1- $+ ]]
- alof {
- if ($1 >= 1073741824) return $round($calc($1 / 1073741824),2) $+ gb
- elseif ($1 >= 1048576) return $round($calc($1 / 1048576),2) $+ mb
- elseif ($1 >= 1024) return $round($calc($1 / 1024),2) $+ kb
- elseif ($1 isnum) return $1 $+ b
- else return 0b
- }
- a.msg return $readini -n $td(msg.txt) $1 m [ $+ [ $2 ] ]
- a.msgno {
- if ($readini -n $td(msg.txt) $1 msgno isnum) return $readini -n $td(msg.txt) $1 msgno
- else return 0
- }
- a.nknum return $readini -n $td(msg.txt) messages nicknumber [ $+ [ $1 ] ]
- a.numnk return $readini -n $td(msg.txt) messages totalnumnk
- a.numsg {
- set %tmp.a.numsg $readini -n $td(msg.txt) messages totalnumsg
- if (%tmp.a.numsg isnum) return %tmp.a.numsg
- else return 0
- }
- ac return $+ %c4 $+ $iif($1 != $null,$1-) $+ $iif($1 != $null,)
- adn return %dir $+ \addon\ $+ $1
- adnl return $read -nl $+ $1 $tp(addonld.txt)
- apd return %dir $+ \addon\pics\ $+ $1
- ascode {
- set %i.ascode 0
- set %j.ascode 0
- :start
- inc %i.ascode
- set %tmp.ascode $mid($3-,%i.ascode,1)
- if (%tmp.ascode != $null) {
- if (%tmp.ascode == $chr(32)) goto start
- elseif (($asc(%tmp.ascode) >= $1) && ($asc(%tmp.ascode) <= $2)) inc %j.ascode
- goto start
- }
- return $mpy($div(%j.ascode,$len($3-)),100)
- }
- atd return %dir $+ \addon\text\ $+ $1
- atime return $asctime(h:nntt)
- asc-time {
- set -u %tmp.asc-time ddd, mmm dd yyyy
- return $asctime($1,%tmp.asc-time) at $asctime($1,h:nntt)
- }
- atp return %dir $+ \addon\temp\ $+ $1
- avar return $readini -n $adn($1) Addon $2
- autoawymsg {
- if (%autousedef == on) return $+ %iver - autoaway after $+ $div(%idle,60) $+ m
- else return %defaulta
- }
- avconv {
- unset %tmp.avconv
- set %j.avconv 0
- set %i.avconv 0
- :start
- inc %i.avconv
- if ($gettok($1-,%i.avconv,32)) {
- if ($exists($adn($gettok($1-,%i.avconv,32))) == $false) {
- inc %j.avconv
- iecho $hc(WARNING!) $hc($gettok($1-,%i.avconv,32)) does not exist, yet addon is still installed!
- }
- else {
- txt2cc $readini -n $adn($gettok($1-,%i.avconv,32)) addon aver
- set %tmp.avconv %tmp.avconv $result
- }
- goto start
- }
- if (%j.avconv) iecho Please replace the .ad2 file(s) to get rid of this error message and allow you to uninstall the addon.
- return %tmp.avconv
- }
- b return $+ $iif($1 != $null,$1-) $+ $iif($1 != $null,)
- backspace {
- if ($1- == $null) return
- var %a, %b, %c
- bunset &backspace.y &backspace.z
- bset -t &backspace.z 1 $1-
- set %a 0
- set %b 0
- :start
- inc %a
- inc %b
- if ($bvar(&backspace.z,%a) != $null) {
- set %c $ifmatch
- if (%c == 8) {
- bset &backspace.y %b 0
- dec %b 2
- if (%b < 0) set %b 0
- goto start
- }
- bset &backspace.y %b %c
- goto start
- }
- return $bvar(&backspace.y,1-).text
- }
- botpass {
- if ($readini -n users.ini $1 botpass != $null) crypt 1 $lower($1) $ifmatch
- if ($result) return $result
- }
- brkt return $b([) $+ $hc($1-) $+ $b(])
- browser return $readini -n mirc.ini Files Browser
- ca {
- if (H isin $1) return HERE
- else return AWAY
- }
- caps return $ascode(65,90,$1-)
- cc2txt return $replace($1-,,<c>,,<b>,,<u>,,<o>,,<r>)
- cent2 return $str( ,$div($sub($1,$len($2-)),2)) $+ $2- $+ $str( ,$div($sub($1,$len($2-)),2))
- cent return $str( ,$div($sub($1,$len($2-)),2)) $+ $2- $+ $str( ,$pls($div($sub($1,$len($2-)),2),1))
- center {
- if ($len($strip($2-)) >= $1) return $2-
- else {
- if ($mod($sub($1,$len($strip($2-))),2) == 0) return $str( ,$int($div($sub($1,$len($strip($2-))),2))) $+ $2- $+ $str( ,$int($div($sub($1,$len($strip($2-))),2)))
- else return $str( ,$int($div($sub($1,$len($strip($2-))),2))) $+ $2- $+ $str( ,$pls($int($div($sub($1,$len($strip($2-))),2)),1))
- }
- }
- cflags return $readini -n users.ini $1 $2
- chkflag {
- if ($3 isincs $flags($1)) return $true
- elseif ($isvalidchan($usrchans($1),$2) && ($3 isincs $cflags($1,$2))) return $true
- elseif ($2 == *) {
- set %i.chkflag 0
- :start
- inc %i.chkflag
- if ($gettok($usrchans($1),%i.chkflag,44)) {
- if ($3 isincs $cflags($1,$gettok($usrchans($1),%i.chkflag,44))) return $true
- goto start
- }
- else return $false
- }
- else return $false
- }
- chkop {
- set %i.chkop 0
- :start
- inc %i.chkop
- if ($chan(%i.chkop) == $null) return $false
- elseif ($me isop $chan(%i.chkop)) && ($1 !ison $chan(%i.chkop)) return $true
- else goto start
- }
- chlist {
- unset %tmp.chlist
- set %i.chlist 0
- :start
- inc %i.chlist
- if ($gettok($1,%i.chlist,44) != $null) {
- if (%i.chlist == 1) set %tmp.chlist $gettok($1,1,44)
- else {
- if (%i.chlist == $gettok($1,0,44)) {
- if (%i.chlist == 2) set %tmp.chlist %tmp.chlist and $gettok($1,%i.chlist,44)
- else set %tmp.chlist %tmp.chlist $+ , and $gettok($1,%i.chlist,44)
- }
- else set %tmp.chlist %tmp.chlist $+ , $gettok($1,%i.chlist,44)
- }
- goto start
- }
- return %tmp.chlist
- }
- chn-key return $readini -n ircndata.ini channel-keys $1
- c return
- clop {
- if ($1 isop $2) return @ $+ $1
- elseif ($1 ishelp $2) return % $+ $1
- elseif ($1 isvo $2) return + $+ $1
- else return $1
- }
- clop2 {
- if ($me isop $1) return @ $+ $1
- elseif ($me ishelp $1) return % $+ $1
- elseif ($me isvo $1) return + $+ $1
- else return $1
- }
- com.channels {
- unset %tmp.com.channels
- set %i.com.channels 0
- :start
- inc %i.com.channels
- if ($comchan($1,%i.com.channels)) {
- set %tmp.com.channels $addtok(%tmp.com.channels,$comchan($1,%i.com.channels),44)
- goto start
- }
- return %tmp.com.channels
- }
- com.opchannels {
- unset %tmp.com.opchannels
- set %i.com.opchannels 0
- :start
- inc %i.com.opchannels
- if ($comchan($1,%i.com.opchannels)) {
- if ($me isop $comchan($1,%i.com.opchannels)) set %tmp.com.opchannels $addtok(%tmp.com.opchannels,$comchan($1,%i.com.opchannels),44)
- goto start
- }
- return %tmp.com.opchannels
- }
- cnum if ($len($1) < 2) return 0 $+ $1 | else return $1
- colnum return $+ $cnum($colour($1))
- cpms {
- if (($1 == $null) || (($1 isnum) && ($2 == $null))) return .
- else return : $1-
- }
- crypt {
- if ($3- == $null) return
- bunset &crypt.y &crypt.z
- var %a, %z
- set %z $2
- set %a $len($3-)
- while (%a > 0) {
- set %z $hash(%z,32)
- bset -t &crypt.z $calc($bvar(&crypt.z,0) + 1) %z
- dec %a $len(%z)
- }
- bset -t &crypt.z $calc($bvar(&crypt.z,0) + 1) %z
- bset -t &crypt.y 1 $3-
- set %a 1
- while ($bvar(&crypt.y,%a) != $null) {
- bset &crypt.y %a $calc($ifmatch - ($1 * 2 - 1) * ($bvar(&crypt.z,%a) - 48))
- inc %a
- }
- return $bvar(&crypt.y,1-).text
- }
- current if ($1 != $null) return (current $1 $+ )
- dd return %dir $+ \docs\ $+ $1-
- de-op {
- if (($1 isop $2) && ($3 == sb)) return +b-o $address($1,4) $1
- elseif ($1 isop $2) return +b-o $address($1,%kbmask) $1
- elseif ($3 == sb) return +b $address($1,4)
- else return +b $address($1,%kbmask)
- }
- d.g {
- if (($get($1).cps == n/a) || ($get($1).cps == 0)) return n/a
- else return $2
- }
- div {
- if (($1 isnum) && ($2 isnum)) return $calc($1 / $2)
- elseif (($1 isnum) && ($2 == $null)) return $1
- elseif (($1 == $null) && ($2 isnum)) return 0
- elseif (($1 == $null) && ($2 == $null)) return
- else iecho DIV Error, $1 and $2 are not numbers!
- }
- d.s {
- if ($1 == n/a) return 0
- else return $1
- }
- e-mail if (%em == on) return [email: $+ $1 $+ ]
- ed return %dir $+ \email\ $+ $1
- fix return $2- $+ $str( ,$sub($1,$len($strip($2-))))
- fix2 return $2- $+ $str(á,$sub($1,$len($strip($2-))))
- fix.ver {
- if (($1) && ($1- !isin %ver)) return %ver + $1-
- else return %ver
- }
- flags return $readini -n users.ini $1 flags
- form {
- if ((%sthemes == on) && (%formats)) {
- if ($2) return $readini %formats $1 $2
- else return $readini %formats $1 use
- }
- }
- full-date return $asc-time($ctime)
- getadd return $gettok($1,2,33)
- getcenter return $int($sub($div($window(-3).w,2),$div($1,2))) $int($sub($div($window(-3).h,2),$div($2,2))) $1 $2
- getdate {
- set %tmp.getdate dddd, mmmm d h:nn tt yyyy
- return $replace($asctime(%tmp.getdate),pm,PM,am,AM)
- }
- getline return $read -s [ $+ [ $2 ] ] $1
- getleft return $left($1-,-1)
- getright return $right($1-,-1)
- getnick return $nocolon($gettok($1,1,33))
- gettz return $asctime(zz)
- gone {
- if ($away) return $rsc($duration($sub($ctime,%awaytime)))
- else return 0s
- }
- hc return $+ %c2 $+ $iif($1 != $null,$1-) $+ $iif($1 != $null,)
- hlag {
- if (%lag isnum) return [l: $+ %lag $+ ]
- else return
- }
- hstmask {
- if ($2 == $null) return $readini -n users.ini $1 hostmask
- else return $gettok( [ $readini -n users.ini $1 hostmask ] ,$2,32)
- }
- iduration {
- if ($1 !isnum) {
- iecho IDURATION: $1 is not a number!
- return
- }
- if ($1 < 60) return $1 second $+ $plural($1)
- elseif ($1 < 3600) return $int($div($1,60)) minute $+ $plural($int($div($1,60))) $+ , $mod($1,60) second $+ $plural($mod($1,60))
- else return $duration($round($1,0))
- }
- inscma {
- if ($len($1) < 4) return $1
- elseif ($len($1) < 7) return $left($1,$sub($len($1),3)) $+ , $+ $right($1,3)
- elseif ($len($1) < 10) {
- set %tmp1 $right($1,6)
- set %tmp2 $left(%tmp1,3)
- return $left($1,$sub($len($1),6)) $+ , $+ %tmp2 $+ , $+ $right($1,3)
- }
- else {
- set %tmp1 $right($1,9)
- set %tmp2 $mid(%tmp1,4,3)
- return $left($1,$sub($len($1),9)) $+ , $+ $left(%tmp1,3) $+ , $+ %tmp2 $+ , $+ $right($1,3)
- }
- }
- infoline {
- if ($2) return $readini -n users.ini $1 $addtok(infoline,$2,46)
- else return $readini -n users.ini $1 infoline
- }
- iscloaked {
- if ($chkflag($usrh($1),$null,m)) return $false
- if (% [ $+ [ $addtok(cloak,$2,46) ] ] == on) return $true
- return $false
- }
- isopped {
- set %i.isopped 0
- :start
- inc %i.isopped
- if ($chan(%i.isopped)) {
- if ($1 isop $chan(%i.isopped)) return $true
- goto start
- }
- return $false
- }
- ispwctcp1 if ($istok($addtok(CHAN OP INVITE INFO IDENT NOTES,%pwctcp1,32),$1,32)) return $true
- ispwctcp2 if ($istok($addtok(PASS,%pwctcp2,32),$1,32)) return $true
- isvalidchan if (($findtok($1,$2,1,44)) || ($1 == all)) return $true
- kps return $round($div($1,1024),1)
- lfix return $str( ,$sub($1,$len($strip($2-)))) $+ $2-
- lfix2 return $str(á,$sub($1,$len($strip($2-)))) $+ $2-
- middir return $mididir $+ $1-
- lgdir return $logdir $+ $1-
- mail.add return $readini -n ircndata.ini $1 email
- mail.ip return $readini -n ircndata.ini $1 mailip
- mail.name return $readini -n ircndata.ini $1 username
- mail.pass {
- crypt 1 $lower($1) $readini -n ircndata.ini $1 emailpass
- return $result
- }
- mflag return $gettok($mirc.ini($1,$2),$3,44)
- mirc.ini return $readini -n $mircini $1 $2
- mp3dir return %dir $+ \mp3\ $+ $1
- mpy {
- if (($1 isnum) && ($2 isnum)) return $calc($1 * $2)
- elseif ((($1 isnum) && ($2 == $null)) || (($1 == $null) && ($2 isnum))) return 0
- elseif (($1 == $null) && ($2 == $null)) return
- else iecho MPY Error, $1 and $2 are not numbers!
- }
- mychans return $com.channels($me)
- nc {
- if ((%nc == on) && ($1)) {
- if ($2) {
- if ($remove($1,%nch) ison $2) return $ialchan( [ [ $remove($1,%nch) ] $+ ] !*@*,$2,1).nick
- elseif ($ialchan( [ [ $remove($1,%nch) ] $+ ] *!*@*,$2,1).nick) return $ialchan( [ [ $remove($1,%nch) ] $+ ] *!*@*,$2,1).nick
- elseif ($ialchan(* [ $+ [ $remove($1,%nch) ] $+ ] *!*@*,$2,1).nick) return $ialchan(* [ $+ [ $remove($1,%nch) ] $+ ] *!*@*,$2,1).nick
- }
- else {
- if ($1 ison $active) return $1
- elseif ($ialchan( [ [ $1 ] $+ ] *!*@*,$active,1).nick) return $ialchan( [ [ $1 ] $+ ] *!*@*,$active,1).nick
- elseif ($ialchan(* [ $+ [ $1 ] $+ ] *!*@*,$active,1).nick) return $ialchan(* [ $+ [ $1 ] $+ ] *!*@*,$active,1).nick
- else return $1
- }
- }
- else return $1
- }
- ncomp {
- if ((%ncstyle == random) && ($form(nickcomp,styles))) return $readini %formats nickcomp $gettok($form(nickcomp,styles),$rand(1,$gettok($form(nickcomp,styles),0,44)),44)
- elseif ($form(nickcomp,%ncstyle)) return $readini %formats nickcomp %ncstyle
- else return %nlb $+ $1 $+ %nrb
- }
- nd return %dir $+ \network\ $+ %irc.network $+ . $+ $1
- nll {
- if ($1 != $null) return $1
- else return
- }
- nocolon {
- if ($left($1,1) == :) return $right($1-,$sub($len($1-),1))
- else return $1-
- }
- ns.rnick return $readini -n $tp(wholeft.txt) $1 n $+ [ $2 ]
- ns.rnick2 return $readini -n $tp(wholeft.txt) $1 n $+ [ $2 ]
- ns.rserv return $readini -n $tp(wholeft.txt) splitservers n $+ [ $1 ]
- nv return [w $+ $os $+ /u $+ %uses $+ /mb $+ $bits $+ v $+ $gettok($version,1,46) $+ $+ $gettok($version,2,46) $+ ]
- o return
- oc if ($1 == on) return $ab($2)
- ocenter {
- if ($len($strip($2-)) >= $1) return $2-
- else {
- if ($mod($sub($1,$len($strip($2-))),2) == 0) return $str( ,$int($div($sub($1,$len($strip($2-))),2))) $+ $2- $+ $str( ,$int($div($sub($1,$len($strip($2-))),2)))
- else return $str( ,$int($div($sub($1,$len($strip($2-))),2))) $+ $2- $+ $str( ,$pls($int($div($sub($1,$len($strip($2-))),2)),1))
- }
- }
- pages return $iif($isfile($td(page.txt)),$lines($td(page.txt)),0)
- paren if ($1) return ( $+ $1- $+ )
- password {
- if ($readini -n users.ini $1 password != $null) crypt 1 $lower($1) $ifmatch
- if ($result) return $result
- }
- pc return $+ $colour(Normal) $+ $iif($1 != $null,$1-) $+ $iif($1 != $null,)
- pls {
- if (($1 isnum) && ($2 isnum)) return $calc($1 + $2)
- elseif (($1 isnum) && ($2 == $null)) return $1
- elseif (($1 == $null) && ($2 isnum)) return $2
- elseif (($1 == $null) && ($2 == $null)) return
- else iecho PLS Error, $1 and $2 are not numbers!
- }
- plural if ($1 != 1) return s
- pst {
- if (%userstatus == on) {
- if ($1 isop $2) {
- if ($chkflag($usr($1),$2,o)) return $hc(@) $+ $1
- elseif ($me isop $2) return $ac(@) $+ $1
- else return $sc(@) $+ $1
- }
- elseif ($1 isvo $2) {
- if (($chkflag($usr($1),$2,v)) || ($chkflag($usr($1),$2,o))) return $hc(+) $+ $1
- else return $sc(+) $+ $1
- }
- elseif ($usr($1)) return $hc(!) $+ $1
- else return $sc(!) $+ $1
- }
- else return $1
- }
- pst2 {
- if (%userstatus == on) {
- if ($1 isop $2) {
- if ($chkflag($usr($1),$2,o)) return $hc(@)
- elseif ($me isop $2) return $ac(@)
- else return $sc(@)
- }
- elseif ($1 isvo $2) {
- if (($chkflag($usr($1),$2,v)) || ($chkflag($usr($1),$2,o))) return $hc(+)
- else return $sc(+)
- }
- elseif ($usr($1)) return $hc(!)
- else return $sc(!)
- }
- }
- pub return %dir $+ \pub\ $+ $1
- pwr {
- if (($1 isnum) && ($2 isnum)) return $calc($1 ^ $2)
- elseif (($1 isnum) && ($2 == $null)) return 1
- elseif (($1 == $null) && ($2 isnum)) return 0
- elseif (($1 == $null) && ($2 == $null)) return
- else iecho PWR Error, $1 and $2 are not numbers!
- }
- queue1 {
- if ($ddename == $null) ddeset
- if ($ddename == ircN) return $tp(queue1a.txt)
- else return $tp($addtok($addtok(queue,$right($ddename,-4),0),a.txt,0))
- }
- queue2 {
- if ($ddename == $null) ddeset
- if ($ddename == ircN) return $tp(queue1b.txt)
- else return $tp($addtok($addtok(queue,$right($ddename,-4),0),b.txt,0))
- }
- r return $+ $iif($1 != $null,$1-) $+ $iif($1 != $null,)
- rb return $remove($1-,[,])
- rbrk if ($1 != $null) return ( $+ $sc($1-) $+ )
- rndstr {
- unset %tmp.rndstr
- set %i.rndstr 0
- :loop
- inc %i.rndstr
- if (%i.rndstr <= $1) {
- set %j.rndstr $rand(0,2)
- if (%j.rndstr == 0) set %tmp.rndstr %tmp.rndstr $+ $rand(0,9)
- elseif (%j.rndstr == 1) set %tmp.rndstr %tmp.rndstr $+ $rand(a,z)
- elseif (%j.rndstr == 2) set %tmp.rndstr %tmp.rndstr $+ $rand(A,Z)
- goto loop
- }
- return %tmp.rndstr
- }
- root return %dir $+ \ $+ $1
- rot {
- if (($1 isnum) && ($2 isnum) && ($2 != 0)) return $calc($1 ^ (1 / $2))
- elseif (($1 isnum) && ($2 == $null)) return
- elseif (($1 == $null) && ($2 isnum)) return 0
- elseif (($1 == $null) && ($2 == $null)) return
- else iecho ROT Error, $1 and $2 are not numbers!
- }
- rrpt return $round($div($1,1000),3)
- rsc return $remove($rsc2($1-),$chr(32))
- rsc2 return $remove($1-,ecs,ins,rs,ays,ks,ec,in,r,ay,k)
- sc return $+ %c3 $+ $iif($1 != $null,$1-) $+ $iif($1 != $null,)
- scr.name return $readini -n $tp(temp.txt) $1 name
- scr.version return $readini -n $tp(temp.txt) $1 version
- scr.author return $readini -n $tp(temp.txt) $1 author
- scr.email return $readini -n $tp(temp.txt) $1 email
- scr.url return $readini -n $tp(temp.txt) $1 url
- sd if ($isvalidchan($banchans($ulist($address($1,5),20,1)),$2)) return $true
- sqr {
- if ($1 isnum) return $calc($1 ^ 0.5)
- elseif ($1 == $null) return
- else iecho SQR Error, $1 is not a number!
- }
- sub {
- if (($1 isnum) && ($2 isnum)) return $calc($1 - $2)
- elseif (($1 isnum) && ($2 == $null)) return $1
- elseif (($1 == $null) && ($2 isnum)) return $calc(0 - $2)
- elseif (($1 == $null) && ($2 == $null)) return
- else iecho SUB Error, $1 and $2 are not numbers!
- }
- sum {
- set %tmp.sum 0
- set %i.sum 0
- :loop
- inc %i.sum
- if ($gettok($1-,%i.sum,32)) {
- set %tmp.sum $pls(%tmp.sum,$gettok($1-,%i.sum,32))
- goto loop
- }
- return %tmp.sum
- }
- swlc return $window($1).x $window($1).y $window($1).w $window($1).h
- tchan {
- if ($active ischan) return $ab($active) [o: $+ $opnick($active,0) v: $+ $vnick($active,0) n: $+ $rnick($active,0) t: $+ $nick($active,0) $+ ]
- else return [idle: $+ $rsc($duration($idle)) $+ ]
- }
- td return %dir $+ \text\ $+ $1
- tflags {
- unset %tmp.tflags
- if (%partyline == on) set %tmp.tflags %tmp.tflags $+ p
- if (%rcontrol == on) set %tmp.tflags %tmp.tflags $+ r
- if (%tmp.tflags != $null) return telnet: $+ %tmp.tflags
- else return telnet
- }
- themedir return %dir $+ \themes\ $+ $1
- themeld return $read -nl $+ $1 $tp(themeld.txt)
- themefn return $iif(%themefullname,%themefullname,%themename)
- themevar return %theme. [ $+ [ $1 ] ]
- togglec return $iif($1 == $2,&*,_)
- toggled return $iif($1 == on,&*,_)
- toggled2 return $iif($1 == off,_,&*)
- toggler return $iif($1 == on,off,on)
- tokmatch {
- set %i.tokmatch 0
- :start
- inc %i.tokmatch
- if ($gettok($1,%i.tokmatch,$3) != $null) {
- if ($gettok($1,%i.tokmatch,$3) iswm $2) return %i.tokmatch
- else goto start
- }
- }
- tp return %dir $+ \temp\ $+ $1
- trncte return $mod($1,$2)
- mod {
- if (($1 isnum) && ($2 isnum)) return $calc($1 % $2)
- elseif (($1 isnum) && ($2 == $null)) return $calc($1 % 0)
- elseif (($1 == $null) && ($2 isnum)) return $calc(0 % $2)
- elseif (($1 == $null) && ($2 == $null)) return
- else iecho MOD Error, $1 and $2 are not numbers!
- }
- txt2cc return $replace($1-,<c>,,<b>,,<u>,,<o>,,<r>,)
- u return $+ $iif($1 != $null,$1-) $+ $iif($1 != $null,)
- uin if (%showuin == on) return [UIN: $+ $1 $+ ]
- ulcolor {
- if ($3 == 40) {
- if ($chkflag($usr($1),$2,k)) return %cn1
- elseif ($chkflag($usr($1),$null,n)) return %cn8
- elseif ($chkflag($usr($1),$null,m)) return %cn7
- elseif ($chkflag($usr($1),$null,b)) return %cn6
- elseif ($chkflag($usr($1),$2,o)) return %cn5
- elseif ($chkflag($usr($1),$2,v)) return %cn4
- elseif ($chkflag($usr($1),$2,f)) return %cn3
- else return %cn2
- }
- elseif (($3 == 20) && ($sd($1,$2))) return %cn1
- else return $colour(Listbox Text)
- }
- usr return $readini -n users.ini Users $ulist($address($1,5),40,1)
- usrh return $readini -n users.ini Users $ulist($1,40,1)
- usrl {
- if ($usr($1)) return $usr($1)
- elseif ($usrhost($1)) return $1
- }
- usrchans return $readini -n users.ini $1 channels
- banchans return $readini -n bans.ini $1 channels
- usrhost return $readini -n users.ini $1 hostmask
- vl return $chr(124)
- wavdir return $wavedir $+ $1-
- wrap {
- if (($right($mid($3-,$1,$2),1) == $chr(32)) || ($right($mid($3-,$1,$pls($2,1)),1) == $chr(32)) || ($pls($1,$2) > $len($3-))) {
- set %wrap.pos $2
- return $replace($mid($3-,$1,$2),á, )
- }
- set %wrap.text $mid($3-,$1,$2)
- set %wrap.text2 %wrap.text
- set %wrap.pos 0
- if ($chr(32) isin %wrap.text) {
- :sploop
- set %wrap.pos $pls(%wrap.pos,$pos(%wrap.text2,$chr(32)))
- set %wrap.text2 $mid(%wrap.text2,$pls($pos(%wrap.text2,$chr(32)),1),$sub($len(%wrap.text2),$pos(%wrap.text2,$chr(32))))
- if ($pos(%wrap.text2,$chr(32)) > 1) goto sploop
- }
- elseif (á isin %wrap.text) {
- :chloop
- set %wrap.pos $pls(%wrap.pos,$pos(%wrap.text2,á))
- set %wrap.text2 $mid(%wrap.text2,$pls($pos(%wrap.text2,á),1),$sub($len(%wrap.text2),$pos(%wrap.text2,á)))
- if ($pos(%wrap.text2,á) > 1) goto chloop
- }
- else {
- unset %wrap.text2
- set %wrap.pos $2
- return $replace(%wrap.text,á, )
- }
- unset %wrap.text2
- return $replace($left(%wrap.text,%wrap.pos),á, )
- }
- wrpt {
- if ($len($1) < 4) return 0. $+ $str(0,$sub($len($1),1)) $+ $1 $+ s
- elseif ($mid($1,1,$sub($len($1),3)) < 60) return $mid($1,1,$sub($len($1),3)) $+ . $+ $right($1,3) $+ s
- else return $rsc($duration($mid($1,1,$sub($len($1),3))))
- }
-